<script type="text/javascript">
	$(document).ready(function() {
		/*SOCIAL*/		
		$('div.social a').animate({'opacity':'0.5'}, 50);
		$('div.social a').hover( 
		function(){
			$(this).animate({'opacity':'1'}, 200);
		}, function(){
			$(this).animate({'opacity':'.5'}, 200);					  
		});
			
		$(window).load(function() { 
		  $('#menu ul').fadeIn(120);
		})
		
		$('.box-product ul li > div, .product-grid > div, .box-product > div').hover( 
		function(){
			$(this).find('.open_content').fadeIn(300);
		}, function(){
			$(this).find('.open_content').fadeOut(200);
		});

		$('#menu ul li').has('div').addClass('arrow_down');
		$('.box-category > ul > li').has('ul').addClass('cat_arrow_down');
		$('.box-product > div:last').css({'margin-right':'0'});
		$('body').has('.phone').addClass('homa');

		$(window).load(function() { 
			$('#content').wrapInner(document.createElement('span'));
			$("#content > span > .breadcrumb + h1").insertBefore("#content > span");
		})

/*		$('#column-left').css('min-height', $('#content').height());
			$('#content').css('min-height', $('#column-left').height());
	$('#column-right').css('min-height', $('#content').height() );
	    $('#content').css('min-height', $('#column-right').height());
*/
	});

</script>	
<!--[if ! IE]-->					   
<script type="text/javascript">
	$(document).ready(function() {

	});
</script>						   
<!--[endif]-->


<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<?php
$id=$_GET['id']; // lay id tren url
$single=single($id); //goi ham 
$row_single=mysql_fetch_assoc($single);
$urlHinh=getParamsK($row_single['images'], "image_intro");
?>
<div id="column-left">
    <div class="box category">
  <div class="box-heading">Categories</div>
  <div class="box-content">
    <div class="box-category">
      <ul>
                <li>
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=63">Biographies (6)</a>
                            </li>
                <li>
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=61" class="active">Books (7)</a>
                            </li>
                <li>
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=59">e-books (9)</a>
                            </li>
                <li class="cat_arrow_down">
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20">Children (15)</a>
                              <ul>
                        <li>
                            <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20_45"> Early Readers (2)</a>
                          </li>
                        <li>
                            <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20_46"> Family &amp; Growing Up (4)</a>
                          </li>
                        <li>
                            <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20_62"> Fantasy &amp; Magic (3)</a>
                          </li>
                        <li>
                            <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20_28">  Food (5)</a>
                          </li>
                        <li>
                            <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20_29"> Humor (3)</a>
                          </li>
                        <li>
                            <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20_26"> Romance (5)</a>
                          </li>
                        <li>
                            <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=20_27"> Classics (3)</a>
                          </li>
                      </ul>
                  </li>
                <li>
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=60">Cookbooks (5)</a>
                            </li>
                <li>
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=18">Magazines (6)</a>
                            </li>
                <li>
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=25">Medicine (6)</a>
                            </li>
                <li>
                    <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=57">Religion (7)</a>
                            </li>
              </ul>
    </div>
  </div>
</div>
    
<script type="text/javascript"><!--
var banner = function() {
	$('#banner0').cycle({
		before: function(current, next) {
			$(next).parent().height($(next).outerHeight());
		}
	});
}

setTimeout(banner, 2000);
//--></script>    <div style="clear:both"></div>
</div>

<!-- content --> 
<div id="content"><h1><?php echo $row_single['title']?></h1><span>  <div class="breadcrumb">
        <a href="http://template-preview.com/opencart/300111402/index.php?route=common/home">Home</a>
         » <a href="http://template-preview.com/opencart/300111402/index.php?route=product/category&amp;path=61">Books</a>
         » <a href="http://template-preview.com/opencart/300111402/index.php?route=product/product&amp;path=61&amp;product_id=31">Lorem ipsum dolor sit amet, consectetur</a>
      </div>
  
  <div class="product-info">
        <div class="left">
            <div class="image"><a href="#" title="Lorem ipsum dolor sit amet, consectetur" class="fancybox" rel="fancybox"><img src="<?php echo $urlHinh?>" width="700" height="300" title="Lorem ipsum dolor sit amet, consectetur" alt="Lorem ipsum dolor sit amet, consectetur" id="image"></a></div>                  
          </div>
        <div class="right">
      
            
                  
            <div class="review">        
        <div class="share"><!-- AddThis Button BEGIN -->
          <div class="addthis_default_style"><a href="#" class="addthis_button_compact at300m"><span class="at16nc at300bs at15nc at15t_compact at16t_compact"><span class="at_a11y">More Sharing Services</span></span>Share</a> <a href="#" title="Email" target="_blank" class="addthis_button_email at300b"><span class="at16nc at300bs at15nc at15t_email at16t_email"><span class="at_a11y">Share on email</span></span></a><a href="#" title="Print" class="addthis_button_print at300b"><span class="at16nc at300bs at15nc at15t_print at16t_print"><span class="at_a11y">Share on print</span></span></a> <a href="#" title="Facebook" class="addthis_button_facebook at300b"><span class="at16nc at300bs at15nc at15t_facebook at16t_facebook"><span class="at_a11y">Share on facebook</span></span></a> <a href="#" title="Tweet" class="addthis_button_twitter at300b"><span class="at16nc at300bs at15nc at15t_twitter at16t_twitter"><span class="at_a11y">Share on twitter</span></span></a></div>
           
          <!-- AddThis Button END --> 
        </div>
      </div>
          </div>
  </div>
  <div id="tabs" class="htabs"><a class="selected" style="display: inline;" href="#tab-description">Nội Dung</a>
            <a class="" style="display: inline;" href="#tab-review">Thảo Luận (0)</a>
          </div>
  <div style="display: block;" id="tab-description" class="tab-content"><?php echo $row_single['introtext']?>
</div>
      <div style="display:none;" id="tab-review" class="tab-content">
    <div id="review"><div class="content">There are no reviews for this product.</div>
</div>
    <h2 id="review-title">Write a review</h2>
    <b>Your Name:</b><br>
    <input name="name" type="text">
    <br>
    <br>
    <b>Your Review:</b>
    <textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>
    <span style="font-size: 11px;"><span style="color: #FF0000;">Note:</span> HTML is not translated!</span><br>
    <br>
    <b>Rating:</b> <span>Bad</span>&nbsp;
    <input name="rating" value="1" type="radio">
    &nbsp;
    <input name="rating" value="2" type="radio">
    &nbsp;
    <input name="rating" value="3" type="radio">
    &nbsp;
    <input name="rating" value="4" type="radio">
    &nbsp;
    <input name="rating" value="5" type="radio">
    &nbsp; <span>Good</span><br>
    <br>
    <b>Enter the code in the box below:</b><br>
    <input name="captcha" type="text">
    <br>
    <img src="images/index.jpeg" alt="" id="captcha"><br>
    <br>
    <div class="buttons">
      <div class="right"><a id="button-review" class="button"><span>Continue</span></a></div>
    </div>
  </div>
          <div style="clear:both; padding-bottom:1px"></div></span></div>
<!-- end content -->


<script type="text/javascript"><!--
$('.fancybox').fancybox({cyclic: true});
//--></script> 
<script type="text/javascript"><!--
$('#button-cart').bind('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/cart/update',
		type: 'post',
		data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
		dataType: 'json',
		success: function(json) {
			$('.success, .warning, .attention, information, .error').remove();
			
			if (json['error']) {
				if (json['error']['warning']) {
					$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
				
					$('.warning').fadeIn('slow');
				}
				
				for (i in json['error']) {
					$('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>');
				}
			}	 
						
			if (json['success']) {
				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
					
				$('.success').fadeIn('slow');
					
				$('#cart_total').html(json['total']);
				
				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
			}	
		}
	});
});
//--></script>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
	$('#review').slideUp('slow');
		
	$('#review').load(this.href);
	
	$('#review').slideDown('slow');
	
	return false;
});			

//$('#review').load('index.php?route=product/product/review&product_id=31');

$('#button-review').bind('click', function() {
	$.ajax({
		type: 'POST',
		url: 'index.php?route=product/product/write&product_id=31',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),
		beforeSend: function() {
			$('.success, .warning').remove();
			$('#button-review').attr('disabled', true);
			$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> Please Wait!</div>');
		},
		complete: function() {
			$('#button-review').attr('disabled', false);
			$('.attention').remove();
		},
		success: function(data) {
			if (data.error) {
				$('#review-title').after('<div class="warning">' + data.error + '</div>');
			}
			
			if (data.success) {
				$('#review-title').after('<div class="success">' + data.success + '</div>');
								
				$('input[name=\'name\']').val('');
				$('textarea[name=\'text\']').val('');
				$('input[name=\'rating\']:checked').attr('checked', '');
				$('input[name=\'captcha\']').val('');
			}
		}
	});
});
//--></script> 
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script> 
<script type="text/javascript" src="../templates/divstore/js/jquery-ui-timepicker-addon.js"></script> 
<script type="text/javascript"><!--
if ($.browser.msie && $.browser.version == 6) {
	$('.date, .datetime, .time').bgIframe();
}

$('.date').datepicker({dateFormat: 'yy-mm-dd'});
$('.datetime').datetimepicker({
	dateFormat: 'yy-mm-dd',
	timeFormat: 'h:m'
});
$('.time').timepicker({timeFormat: 'h:m'});
//--></script> 
<div style="clear:both"></div>
</div><!--   END  bg_content  -->


